#pragma once

#include "MeshUtils.h"
#include "EngineStuff.h"

class Image2D
{
public:
	Image2D(float NearPlane = 1, float FarPlane = 1000);
	~Image2D(void);
	bool Initialize(const char* textureFilename,int bitmapWidth, int bitmapHeight);	
	bool Render(int, int);		

	XMMATRIX GetProjectionMatrix() {return *ProjectionMatrix;}	
	ID3D11ShaderResourceView* GetTexture() {return g_pTextureRV; }

private:	

	XMMATRIX* ProjectionMatrix;
	bool UpdateBuffers( int, int);
	bool InitializeBuffers(int, int);
	
	ID3D11DepthStencilState*			m_depthDisabledStencilState;
	ID3D11ShaderResourceView*           g_pTextureRV;
	ID3D11Buffer						*m_vertexBuffer;
	ID3D11Buffer						*m_indexBuffer;
	int m_vertexCount;
	int m_indexCount;	
	int m_screenWidth, m_screenHeight;
	int m_bitmapWidth, m_bitmapHeight;
	int m_previousPosX, m_previousPosY;	
};




	